package main

import (
	"encoding/json"
	"fmt"
)

type Monster struct {
	Name string `json:"name"`
	Age  int    `json:"age"`
	Sex  string `json:"sex"`
}

func main() {

	m := Monster{Name: "张三", Age: 18, Sex: "女"}

	data, _ := json.Marshal(m)
	fmt.Println("json result:", string(data))
}
